package com.woniu.service.Impl.homePage;

import com.woniu.dao.homePage.OrdersDetailsTwoDao;
import com.woniu.entity.OrdersDetails;
import com.woniu.service.homePage.IOrdersDetailsTwoService;
import com.woniu.util.ResData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 周权
 * @data 2023/3/13 10:21
 */
@Service
public class OrderDetailsTwoServiceImpl implements IOrdersDetailsTwoService {
    @Autowired
    OrdersDetailsTwoDao ordersDetailsTwoDao;

    @Override
    public ResData<?> getAllOrdersDetails(String ordersId) {
        List<OrdersDetails> ordersDetailsList = ordersDetailsTwoDao.findAllOrdersDetails(ordersId);
        return new ResData<>().ok(ordersDetailsList);
    }

    @Override
    public ResData<?> deleteOrdersDetail(String ordersId) {
        ordersDetailsTwoDao.deleteOrdersDetail(ordersId);
        return new ResData<>().ok();
    }
}
